package com.heima.article.feign;

import com.heima.model.behavior.pojos.ApBehaviorEntry;
import com.heima.model.behavior.pojos.ApLikesBehavior;
import com.heima.model.behavior.pojos.ApUnlikesBehavior;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;


@FeignClient("leadnews-behavior")
public interface BehaviorFeign {

    /**
     * 查询行为实体
     * @param userId
     * @param equipmentId
     * @return
     */
    @GetMapping("/api/v1/behavior_entry/one")
    ApBehaviorEntry findByUserIdOrEquipmentId(@RequestParam("userId") Integer userId, @RequestParam("equipmentId") Integer equipmentId);

    /**
     * 根据行为实体id和文章id查询不喜欢行为
     *
     * @param entryId
     * @param articleId
     * @return
     */
    @GetMapping("/api/v1/unlike_behavior/one")
    Integer findUnLikeByArticleIdAndEntryId(@RequestParam("entryId") Integer entryId, @RequestParam("articleId") Long articleId, @RequestParam("type") short type);

    /**
     * 根据行为实体id和文章id查询点赞行为
     * @return
     */
    @GetMapping("/api/v1/likes_behavior/one")
    Integer findLikeByArticleIdAndEntryId(@RequestParam("entryId") Integer entryId, @RequestParam("articleId") Long articleId, @RequestParam("type") short type);
}